/*
 * BasicNumericAlgebraFunction.cpp
 *
 *  Created on: 21/nov/2010
 *      Author: computer
 */

#include "BasicNumericAlgebraFunction.h"
#include "PlusFunction.h"
#include "MinusFunction.h"
#include "StarFunction.h"
#include "DivideFunction.h"
#include "BooleanFunction.h"
#include "Pattern.h"

void registerBasicNumericAlgebraFunction(Context* toRegister) {
	toRegister->addDeclaration("operator+", createFunction<Integer,Integer,Integer,IIPlusSimplify>("operator+", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator+", createFunction<Real,Integer,Real,FIPlusSimplify>("operator+", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator+", createFunction<Integer,Real,Real,IFPlusSimplify>("operator+", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator+", createFunction<Real,Real,Real,FFPlusSimplify>("operator+", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator+", createFunction<Rational,Rational,Rational,RRPlusSimplify>("operator+", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator+", createFunction<Rational,Integer,Rational,RIPlusSimplify>("operator+", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator+", createFunction<Rational,Real,Real,RFPlusSimplify>("operator+", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator+", createFunction<Real,Rational,Real,FRPlusSimplify>("operator+", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator+", createFunction<Integer,Rational,Rational,IRPlusSimplify>("operator+", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Rational", ""))));

	toRegister->addDeclaration("operator-", createFunction<Integer,Integer,Integer,IIMinusSimplify>("operator-", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator-", createFunction<Real,Integer,Real,FIMinusSimplify>("operator-", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator-", createFunction<Integer,Real,Real,IFMinusSimplify>("operator-", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator-", createFunction<Real,Real,Real,FFMinusSimplify>("operator-", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator-", createFunction<Rational,Rational,Rational,RRMinusSimplify>("operator-", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator-", createFunction<Rational,Integer,Rational,RIMinusSimplify>("operator-", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator-", createFunction<Rational,Real,Real,RFMinusSimplify>("operator-", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator-", createFunction<Real,Rational,Real,FRMinusSimplify>("operator-", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator-", createFunction<Integer,Rational,Rational,IRMinusSimplify>("operator-", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Rational", ""))));

	toRegister->addDeclaration("operator*", createFunction<Integer,Integer,Integer,IIStarSimplify>("operator*", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator*", createFunction<Real,Integer,Real,FIStarSimplify>("operator*", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator*", createFunction<Integer,Real,Real,IFStarSimplify>("operator*", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator*", createFunction<Real,Real,Real,FFStarSimplify>("operator*", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator*", createFunction<Rational,Rational,Rational,RRStarSimplify>("operator*", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator*", createFunction<Rational,Integer,Rational,RIStarSimplify>("operator*", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator*", createFunction<Rational,Real,Real,RFStarSimplify>("operator*", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator*", createFunction<Real,Rational,Real,FRStarSimplify>("operator*", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator*", createFunction<Integer,Rational,Rational,IRStarSimplify>("operator*", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Rational", ""))));

	toRegister->addDeclaration("operator/", createFunction<Integer,Integer,Rational,IIDivideSimplify>("operator/", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator/", createFunction<Real,Integer,Real,FIDivideSimplify>("operator/", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator/", createFunction<Integer,Real,Real,IFDivideSimplify>("operator/", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator/", createFunction<Real,Real,Real,FFDivideSimplify>("operator/", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator/", createFunction<Rational,Rational,Rational,RRDivideSimplify>("operator/", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator/", createFunction<Rational,Integer,Rational,RIDivideSimplify>("operator/", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator/", createFunction<Rational,Real,Real,RFDivideSimplify>("operator/", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator/", createFunction<Real,Rational,Real,FRDivideSimplify>("operator/", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator/", createFunction<Integer,Rational,Rational,IRDivideSimplify>("operator/", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Rational", ""))));

	toRegister->addDeclaration("operator>", createFunction<Integer,Integer,Bool,IIGreaterSimplify>("operator>", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator>", createFunction<Real,Integer,Bool,FIGreaterSimplify>("operator>", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator>", createFunction<Integer,Real,Bool,IFGreaterSimplify>("operator>", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator>", createFunction<Real,Real,Bool,FFGreaterSimplify>("operator>", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator>", createFunction<Rational,Rational,Bool,RRGreaterSimplify>("operator>", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator>", createFunction<Rational,Integer,Bool,RIGreaterSimplify>("operator>", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator>", createFunction<Rational,Real,Bool,RFGreaterSimplify>("operator>", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator>", createFunction<Real,Rational,Bool,FRGreaterSimplify>("operator>", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator>", createFunction<Integer,Rational,Bool,IRGreaterSimplify>("operator>", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Rational", ""))));

	toRegister->addDeclaration("operator<", createFunction<Integer,Integer,Bool,IILessSimplify>("operator<", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator<", createFunction<Real,Integer,Bool,FILessSimplify>("operator<", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator<", createFunction<Integer,Real,Bool,IFLessSimplify>("operator<", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator<", createFunction<Real,Real,Bool,FFLessSimplify>("operator<", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator<", createFunction<Rational,Rational,Bool,RRLessSimplify>("operator<", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator<", createFunction<Rational,Integer,Bool,RILessSimplify>("operator<", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator<", createFunction<Rational,Real,Bool,RFLessSimplify>("operator<", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator<", createFunction<Real,Rational,Bool,FRLessSimplify>("operator<", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator<", createFunction<Integer,Rational,Bool,IRLessSimplify>("operator<", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Rational", ""))));

	toRegister->addDeclaration("operator==", createFunction<Integer,Integer,Bool,IILogicalEqualSimplify>("operator==", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator==", createFunction<Real,Integer,Bool,FILogicalEqualSimplify>("operator==", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator==", createFunction<Integer,Real,Bool,IFLogicalEqualSimplify>("operator==", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator==", createFunction<Real,Real,Bool,FFLogicalEqualSimplify>("operator==", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator==", createFunction<Rational,Rational,Bool,RRLogicalEqualSimplify>("operator==", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator==", createFunction<Rational,Integer,Bool,RILogicalEqualSimplify>("operator==", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator==", createFunction<Rational,Real,Bool,RFLogicalEqualSimplify>("operator==", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator==", createFunction<Real,Rational,Bool,FRLogicalEqualSimplify>("operator==", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator==", createFunction<Integer,Rational,Bool,IRLogicalEqualSimplify>("operator==", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Rational", ""))));

	toRegister->addDeclaration("operator!=", createFunction<Integer,Integer,Bool,IILogicalNEqualSimplify>("operator!=", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator!=", createFunction<Real,Integer,Bool,FILogicalNEqualSimplify>("operator!=", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator!=", createFunction<Integer,Real,Bool,IFLogicalNEqualSimplify>("operator!=", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator!=", createFunction<Real,Real,Bool,FFLogicalNEqualSimplify>("operator!=", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator!=", createFunction<Rational,Rational,Bool,RRLogicalNEqualSimplify>("operator!=", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator!=", createFunction<Rational,Integer,Bool,RILogicalNEqualSimplify>("operator!=", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Integer", ""))));
	toRegister->addDeclaration("operator!=", createFunction<Rational,Real,Bool,RFLogicalNEqualSimplify>("operator!=", Pattern<>(TypePattern("Rational", "")), Pattern<>(TypePattern("Real", ""))));
	toRegister->addDeclaration("operator!=", createFunction<Real,Rational,Bool,FRLogicalNEqualSimplify>("operator!=", Pattern<>(TypePattern("Real", "")), Pattern<>(TypePattern("Rational", ""))));
	toRegister->addDeclaration("operator!=", createFunction<Integer,Rational,Bool,IRLogicalNEqualSimplify>("operator!=", Pattern<>(TypePattern("Integer", "")), Pattern<>(TypePattern("Rational", ""))));
}
